<?php
//创建zip包
$zip = new ZipArchive();
$status = $zip->open(__DIR__."/1.zip",ZipArchive::CREATE | ZipArchive::OVERWRITE);

if($status !== true){
    die("结束");
}

if(!$zip->setPassword("123456")){
    die("设置密码失败");
}

$zip->addFile(__DIR__."/index.php","index.php");
$zip->setEncryptionName("index.php",ZipArchive::EM_AES_256);
$zip->addFile(__DIR__."/index.php","a.php");
$zip->setEncryptionName("a.php",ZipArchive::EM_AES_256);

$zip->close();
